<template>
	
	<view class="asset">
		<view class="head" style="z-index: 999;">
			<view class="head_text" @click="black()">返回</view>
			<image src="../../../static/public/img/fh.png"
				style="width: 18px;height: 18px;position: absolute;top:33px;left: 15px;"></image>
				<view style="width:45%;height: 30px;border-radius: 10px;font-size: 13px;border: 1px solid white; position: absolute;top: 25px;left: 29%;">
					<view :class="gg_class" @click="gg()">公告</view>
					<view :class="msg_class" @click="msg()">消息</view>
				</view>
		</view>
		
		<view style="width:100%;height: 65px;background-color:white;padding-bottom: 3%;" v-for="(item,index) in data" @click="noti(item.id)">
			<view style="width: 70%;color: #818181;font-size: 14px;float: left;padding-left: 3%;padding-top: 3%;">{{item.title}}</view>
			<!--<view style="width: 20%;color:red;font-size: 14px;float: left;padding-left: 3%;padding-top: 3%;">+10000.00</view>-->
			
			<view style="width: 100%;color: #818181;font-size: 12px;float: left;padding-left: 3%;padding-top: 3%;">
				<text>{{item.created_at}}</text>
			</view>
		</view>
		
	
		
	
			
	

	</view>
</template>

<script>
	//导入组件
	export default {
		data() {
			return {
				gg_class:'xzs',
				msg_class:'xz',
				data:[],
				// gg:true
			}
		},
		methods: {
			   gg(){
				   this.gg_class='xzs';
				   this.msg_class='xz';
			   },
			   msg(){
				   this.gg_class='xz';
				   this.msg_class='xzs';
			   },
			   black(){
				   uni.navigateBack()
			   },
			   home(){
				   this.$api.request('/api/getNoticeList').then((res)=>{
				   					   this.data = res.data
				   })
			   },
			   noti(id){
				   uni.navigateTo({
				   	url:'/pages/components/about/abouts?id=' + id
				   })
			   }
		},
		onShow() { 

		},
		onLoad() {
			this.home()
		}

	}
</script>

<style lang="scss">
	page {
		background-color:#ddd;
	}

	.asset {
	   .head {
	   	background: #151516 !important;
	   	color: #fff;
	   	height: 130rpx;
	   	font-size: 18px;
	   }
	   
	   .head_text {
		 font-size: 14px;
         margin-left: 9%;
	   	 line-height: 160rpx;
	   }
	   .item{
		   width: 100%;
		   float: left;
		   margin-top: 5%;
		   border-bottom: 1px solid #ddd;
		   padding-bottom: 3%;
	   }
	   .xzs{
		   background: white;
		   float: left;
		   color:black;
		   width:50%;
		   height: 30px;
		   line-height: 30px;
		   text-align: center;
		   border-radius: 10px;
	   }
	   .xz{
		   background: black;
		   float: left;
		   width:50%;
		   height: 30px;
		   line-height: 30px;
		   text-align: center;
		   border-radius: 10px;
	   }


	}
</style>
